package chp07.homework;

import java.util.Arrays;
import java.util.Scanner;

public class Home5b {

    public static void main(String[] args) {
        int[] nums = new int[10];
        Scanner input = new Scanner(System.in);
        for (int i = 0; i < nums.length; i++) {
            System.out.print("第"+(i+1)+"个数:");
            nums[i] = input.nextInt();
        }
        System.out.println(Arrays.toString(nums));

        int[] count = new int[4];
        for (int i = 0; i < nums.length; i++) {
            if(nums[i]>=1 && nums[i]<=3){
                //合法
                count[nums[i]]++;
            }else{
                //不合法
                count[0]++;
            }
        }
        System.out.println("数字1的个数:"+count[1]);
        System.out.println("数字2的个数:"+count[2]);
        System.out.println("数字3的个数:"+count[3]);
        System.out.println("非法数字个数:"+count[0]);
    }
}
